package com.example.demo.service.impl;

import com.example.demo.dao.SensorMapper;
import com.example.demo.modal.Sensor;
import com.example.demo.service.SensorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SensorServiceImpl implements SensorService {
    @Autowired
    SensorMapper sensorMapper;

    public List<Sensor> findAll(){return sensorMapper.selectAll();};
    public Integer SelectMaxId(){return sensorMapper.selsctMaxId();};
    public int save(Sensor sensor){return sensorMapper.insert(sensor);}
    public int update(Sensor sensor){
        return sensorMapper.updateByPrimaryKey(sensor);
    }
    public void delete(Integer id){ sensorMapper.deleteByPrimaryKey(id);}

    public List<Sensor> findSensoId(Integer id){return sensorMapper.selectByPrimaryKey(id) ;}
    public List<Sensor> findSensoCategory(String id){return sensorMapper.selectBySensoCategory(id) ;}
    public List<Sensor> findSensoName(String id){return sensorMapper.selectBySensoName(id) ;}
    public List<Sensor> findNameEngli(String id){return sensorMapper.selectByNameEngli(id) ;}
    public List<Sensor> findPhysiCount(Integer id){return sensorMapper.selectByPhysiCount(id) ;}
    public List<Sensor> findPhysiQuantity1(String id){return sensorMapper.selectByPhysiQuantity1(id) ;}
    public List<Sensor> findPhysiQuantity2(String id){return sensorMapper.selectByPhysiQuantity2(id) ;}
    public List<Sensor> findPhysiQuantity3(String id){return sensorMapper.selectByPhysiQuantity3(id) ;}
    public List<Sensor> findSensoPrinc(String id){return sensorMapper.selectBySensoPrinc(id) ;}
    public List<Sensor> findSensoAccur(String id){return sensorMapper.selectBySensoAccur(id) ;}
    public List<Sensor> findEfficTime(String id){return sensorMapper.selectByEfficTime(id) ;}
    public List<Sensor> findSensoAppli(String id){return sensorMapper.selectBySensoAppli(id) ;}
    public List<Sensor> findSensoLimit(String id){return sensorMapper.selectBySensoLimit(id) ;}
    public List<Sensor> findSensoWeigh(String id){return sensorMapper.selectBySensoWeigh(id) ;}
    public List<Sensor> findSensoVolum(String id){return sensorMapper.selectBySensoVolum(id) ;}
    public List<Sensor> findSensoMater(String id){return sensorMapper.selectBySensoMater(id) ;}
    public List<Sensor> findCostTime(String id){return sensorMapper.selectByCostTime(id) ;}
    public List<Sensor> findCostMoney(String id){return sensorMapper.selectByCostMoney(id) ;}
}
